<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="icon" href="https://static.nowcoder.com/images/logo_87_87.png"/>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
          crossorigin="anonymous">
    <link rel="stylesheet" href="../../css/global.css" th:href="@{/css/global.css}"/>
    <title>牛客网-数据统计</title>
</head>
<body>
<div class="nk-container">
    <!-- 头部 -->
    <header class="bg-dark sticky-top" th:replace="index::header">
        <div class="container">
            <!-- 导航 -->
            <nav class="navbar navbar-expand-lg navbar-dark">
                <!-- logo -->
                <a class="navbar-brand" href="#"></a>
                <button class="navbar-toggler" type="button" data-toggle="collapse"
                        data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
                        aria-expanded="false" aria-label="Toggle navigation">
                    <span class="navbar-toggler-icon"></span>
                </button>
                <!-- 功能 -->
                <div class="collapse navbar-collapse" id="navbarSupportedContent">
                    <ul class="navbar-nav mr-auto">
                        <li class="nav-item ml-3 btn-group-vertical">
                            <a class="nav-link" href="../../index.html">首页</a>
                        </li>
                        <li class="nav-item ml-3 btn-group-vertical">
                            <a class="nav-link position-relative" href="../letter.html">消息<span
                                    class="badge badge-danger">12</span></a>
                        </li>
                        <li class="nav-item ml-3 btn-group-vertical">
                            <a class="nav-link" href="../register.html">注册</a>
                        </li>
                        <li class="nav-item ml-3 btn-group-vertical">
                            <a class="nav-link" href="../login.html">登录</a>
                        </li>
                        <li class="nav-item ml-3 btn-group-vertical dropdown">
                            <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button"
                               data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                <img src="http://images.nowcoder.com/head/1t.png" class="rounded-circle"
                                     style="width:30px;"/>
                            </a>
                            <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                                <a class="dropdown-item text-center" href="../profile.html">个人主页</a>
                                <a class="dropdown-item text-center" href="../setting.html">账号设置</a>
                                <a class="dropdown-item text-center" href="../login.html">退出登录</a>
                                <div class="dropdown-divider"></div>
                                <span class="dropdown-item text-center text-secondary">nowcoder</span>
                            </div>
                        </li>
                    </ul>
                    <!-- 搜索 -->
                    <form class="form-inline my-2 my-lg-0" action="../site/search.html">
                        <input class="form-control mr-sm-2" type="search" aria-label="Search"/>
                        <button class="btn btn-outline-light my-2 my-sm-0" type="submit">搜索</button>
                    </form>
                </div>
            </nav>
        </div>
    </header>

    <!-- 内容 -->
    <div class="main">
        <!-- 网站UV -->
        <div class="container pl-5 pr-5 pt-3 pb-3 mt-3">
            <h6 class="mt-3"><b class="square"></b> 网站 UV</h6>
            <form class="form-inline mt-3" method="post" th:action="@{/data/uv}">
                <input type="date" class="form-control" required name="start"
                       th:value="${#dates.format(uvStartDate, 'yyyy-MM-dd')}"/>
                <input type="date" class="form-control ml-3" required name="end"
                       th:value="${#dates.format(uvEndDate, 'yyyy-MM-dd')}"/>
                <button type="submit" class="btn btn-primary ml-3">开始统计</button>
            </form>
            <ul class="list-group mt-3 mb-3">
                <li class="list-group-item d-flex justify-content-between align-items-center">
                    统计结果
                    <span class="badge badge-primary badge-danger font-size-14" th:text="${uvResult}">0</span>
                </li>
            </ul>
        </div>
        <!-- 活跃用户 -->
        <div class="container pl-5 pr-5 pt-3 pb-3 mt-4">
            <h6 class="mt-3"><b class="square"></b> 活跃用户</h6>
            <form class="form-inline mt-3" method="post" th:action="@{/data/dau}">
                <input type="date" class="form-control" required name="start"
                       th:value="${#dates.format(dauStartDate, 'yyyy-MM-dd')}"/>
                <input type="date" class="form-control ml-3" required name="end"
                       th:value="${#dates.format(dauEndDate, 'yyyy-MM-dd')}"/>
                <button type="submit" class="btn btn-primary ml-3">开始统计</button>
            </form>
            <ul class="list-group mt-3 mb-3">
                <li class="list-group-item d-flex justify-content-between align-items-center">
                    统计结果
                    <span class="badge badge-primary badge-danger font-size-14" th:text="${dauResult}">0</span>
                </li>
            </ul>
        </div>
    </div>

    <!-- 尾部 -->
    <footer class="bg-dark" th:replace="index::footer">
    </footer>
</div>

<script src="https://code.jquery.com/jquery-3.3.1.min.js" crossorigin="anonymous"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/popper.js/2.9.1/cjs/popper.min.js" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" crossorigin="anonymous"></script>
<script src="../../js/global.js" th:href="@{/js/global.js}"></script>
</body>
</html>
